import request from '@/router/axios'
import store from '@/store'
import {
  getMappingStatus,
  fenExYuangettoFixed,
  getStationName,
  getLineName,
  xieChaStatus, getXieChaStatusFormat,getAssistCategory,assistCategoryStationData
} from "../../../subwayRat/commonCheck";
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  selection: true,
  reserveSelection:true,
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  height: 450,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    type: 'input',
    hide: true
  }, {
    label: '线路',
    prop: 'lineCode',
    type: 'select',
    hide:true,
    search: false,
    searchslot:true,
    // filterable : true,
    // cascaderItem: ["stationCode"],
    // props: {
    //   label: 'name',
    //   value: 'code'
    // },
    // dicUrl: "/check/check/getLineAll",
    display: true, // 动态显隐控制不能删除
    formatter:function (row,v) {
      return getLineName(v);
    }

  }, {
    hide: false,
    label: '站点',
    prop: 'stationCode',
    type: 'select',
    search: true,
    searchslot:true,
    // filterable : true,
    // dicFlag: false,
    // cascaderItem: ["equipmentNumber"],
    // props: {
    //   label: 'name',
    //   value: 'code'
    // },
    // dicUrl: "/check/check/getStationByCode?line_code={{key}}",
    display: true, //动态显隐控制不能删除
    formatter:function (row,v) {
      return getStationName(row.lineCode,v);
    }
  },  {
    label: '收入日期',
    prop: 'recordTime',
    type: 'date',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: true,
    width: 90
  }, {
    hide: false,
    label: '设备操作号',
    prop: 'equipmentNumber',
    type: 'select',
    searchLabelWidth: 90,
    search: true,
    searchslot:true,
    width: 90,
    // filterable : true,
    // dicFlag: false,
    // props: {
    //   label: 'operationCode',
    //   value: 'operationCode'
    // },
    // dicUrl: "/check/check/getSwPmDeviceOperationCodeList?stationCode={{key}}",
    display: true// 动态显隐控制不能删除
  }, {
    label: '售票员',
    prop: 'conductorPersonName',
    search: false,
    hide: false,
  }, {
    label: '员工号',
    prop: 'conductorPersonCode',
    search: false,
    searchslot : true,
    hide: false,
  }, {
    hide: false,
    label: 'BOM编号',
    prop: 'bomCode',
    type: 'select',
    search: false,
    searchslot : true,
    display: true// 动态显隐控制不能删除
  },{
    label: 'BOM实点金额',
    prop: 'paidAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'paidAmount');
    },
    search: false,
    hide: false,
    width: 120
  },{
    width: 140,
    label: 'SC系统数据金额',
    prop: 'sysAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'sysAmount');
    },
    search: false,
    hide: true
  },{
    width: 120,
    label: 'SC售票金额',
    prop: 'scSellAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'scSellAmount');
    },
    search: false,
    hide: true
  },{
    width: 120,
    label: 'SC充值金额',
    prop: 'scInvestAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'scInvestAmount');
    },
    search: false,
    hide: true
  },  {
    width: 120,
    label: 'SC补票金额',
    prop: 'scFaretkAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'scFaretkAmount');
    },
    search: false,
    hide: true
  }, {
    label: '协查流程状态',
    width:160,
    searchLabelWidth: 120,
    type: 'select',
    prop: 'assistState',
    dicData:xieChaStatus(),
    formatter:function (row, v) {
      return getXieChaStatusFormat(v);
    },
    search: true,
  },{
    label: '差异金额',
    prop: 'diffMoney',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'diffMoney');
    },
    search: false,
    hide: true
  }, {
    label: '通知时间',
    prop: 'assistTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: true,
    width: 90
  }, {
    width: 160,
    hide: false,
    label: '机电回馈差异原因',
    type: 'select',
    searchLabelWidth: 130,
    prop: 'jdReplyReason',
    formatter:function (row,v) {
      return getMappingStatus('JD_REPLY_REASON',v);
    },
    dicData:[{
      label: '系统原因',
      value: '1'
    }, {
      label: '非系统原因',
      value: '2'
    }],
    search: true,
  }, {
    hide: false,
    label: '车站回馈差异原因',
    prop: 'kyReplyReason',
    formatter:function (row,v) {
      return getMappingStatus('KY_REPLY_REASON',v);
    },
    search: false,
    width: 160
  }, {
    hide: true,
    label: '是否回馈',
    prop: 'replyStatus',
    formatter:function (row, value , label, column){
      return value == 1?'已回馈':'未回馈';
    },
    search: false
  }, {
      hide: false,
      label: '协查类型',
      type: 'select',
      searchLabelWidth:130,
      prop: 'assistCategory',
      formatter:function (row,v) {
       return getAssistCategory(v);
      },
      search: true,
      dicData:assistCategoryStationData(),
      width: 120
    }]
}
export function getSwAuConductorToBeCheckedList(param) {
  return request({
    url: '/check/checkNew/getSwAuConductorToBeCheckedList',
    method: 'post',
    data: param
  })
}
export function updateSwAuConductorToBeChecked(param) {
  return request({
    url: '/check/checkNew/getSwAuConductorToBeCheckedList',
    method: 'post',
    data: param
  })
}
